<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
	<head>
		<title>UserData</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="featured" content="yes"><meta name="title" content="Samples" />
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<link rel="icon" href="../common/favicon.ico" type="image/x-icon" />
		<link rel="shortcut icon" href="../common/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="../common/css/style.css" type="text/css" media="screen" />

	</head>
	<body onload="doOnLoad();">
        <div class="header">
            <a class="logo" href="http://www.dhtmlx.com" title="DHTMLX homepage"></a>
            <div class="tittle-dhtmlx">DHTMLX Docs & Samples Explorer</div>
            <div class="search-field">
                <form action="http://docs.dhtmlx.com/doku.php" accept-charset="utf-8" id="dw__search"><div class="no"><input type="hidden" name="do" value="search" /><input type="text" id="qsearch__in" accesskey="f" name="id" title="Search" /><input class="button" type="submit" value=""><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form>
            </div>
            <div class="buttons">
                <a class="doc_inact" href="../../../docsExplorer/index.html" title="DHTMLX Documentation homepage"></a>
                <a class="sample"></a>
            </div>
        </div>
        <div class="content">
            <div class="navigation-div">
                <a href="../../../docsExplorer/samples.html" class="navigation"><img src="../common/icons/file.gif" alt="" >All components</a>
                <div class="arrow"></div>
                <a href="../index.html" class="navigation"><img height="22" src="../common/icons/form.gif" alt="" >dhtmlxForm</a>
                <div class="arrow"></div>
                <a href="./index.html" class="navigation"><img src="../common/icons/none.gif" alt="" >API</a>
            </div>
            <div style="display:block;">
                <h3>UserData</h3>
            </div>
            <div class="navigation-div">
                <a href="#code" class="navigation view-source"><img src="../common/icons/source.gif" alt="" >View page source</a>
            </div>
            <link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxform_dhx_skyblue.css">
	<script src="../../codebase/dhtmlxcommon.js"></script>
	<script src="../../codebase/dhtmlxform.js"></script>
	<style>
		div#simpleLog, div#simpleLog2 {
			font-family: Tahoma;
			font-size: 11px;
			margin: 20px 20px 0px 0px;
		}
	</style>
	<script>
		var myForm, formData, logObj;
		var myForm2, logObj2;
		function doOnLoad() {
			
			// init from json
			
			formData = [
				{type: "settings", position: "label-left", labelWidth: 130, inputWidth: 120},
				{type: "fieldset", label: "Init from JSON", inputWidth: "auto", list:[
					{type: "radio", name: "type", label: "Already have account", labelWidth: "auto", value: "have_account", position: "label-right", checked: true, list:[
						{type: "input", label: "Login", value: "p_rossi", name: "login", userdata: {
							max_lentgh: 15,
							char_allowed: "a-zA-Z0-9_-"
						}},
						{type: "password", label: "Password", value: "123"},
						{type: "checkbox", label: "Remember me", checked: true}
					], userdata: {
						check_session: true,
						exp_days: 10
					}},
					{type: "radio", name: "type", label: "Not registered yet", labelWidth: "auto", position: "label-right", list:[
						{type: "input", label: "Login", value: "p_rossi"},
						{type: "password", label: "Password", value: "123"},
						{type: "password", label: "Confirm Password", value: "123"},
						{type: "input", label: "E-mail Address", value: "p_rossi@example.com"}
					]},
					{type: "button", value: "Proceed", name: "proceed", userdata: {
						skip_validation: true
					}}
				]}
			];
			myForm = new dhtmlXForm("myForm", formData);
			checkUserData(myForm, log);
			
			// init from xml
			myForm2 = new dhtmlXForm("myForm2");
			myForm2.loadStruct("../common/dhxform_userdata.xml?e="+new Date().getTime(), function(){
				checkUserData(myForm2, log2);
			});
			
		}
		
		function checkUserData(form, log) {
			
			// add some user data manualy
			form.setUserData("type", "have_account", "check_msg", false);
			form.setUserData("proceed", "session_id", form._genStr(6));
			
			// read userdata
			log("form loaded, attempt to read userdata<br>");
			log("input 'Login', <span style='color:blue;'>userdata</span>: max_length, <span style='color:green;'>value</span>: "+form.getUserData("login", "max_lentgh")+"<br>");
			log("input 'Login', <span style='color:blue;'>userdata</span>: exp_days, <span style='color:green;'>value</span>: "+form.getUserData("login", "char_allowed")+"<br>");
			log("radiobutton 'Already have account', <span style='color:blue;'>userdata</span>: check_session, <span style='color:green;'>value</span>: "+form.getUserData("type", "have_account", "check_session").toString()+"<br>");
			log("radiobutton 'Already have account', <span style='color:blue;'>userdata</span>: exp_days, <span style='color:green;'>value</span>: "+form.getUserData("type", "have_account", "exp_days")+"<br>");
			log("radiobutton 'Already have account', <span style='color:blue;'>userdata</span>: check_msg, <span style='color:green;'>value</span>: "+form.getUserData("type", "have_account", "check_msg").toString()+"<br>");
			log("button 'Proceed', <span style='color:blue;'>userdata</span>: skip_validation, <span style='color:green;'>value</span>: "+form.getUserData("proceed", "skip_validation").toString()+"<br>");
			log("button 'Proceed', <span style='color:blue;'>userdata</span>: session_id, <span style='color:green;'>value</span>: "+form.getUserData("proceed", "session_id")+"<br>");
			
		}
		
		function log(t) {
			if (!logObj) logObj = document.getElementById("simpleLog");
			logObj.innerHTML += t;
		}
		
		function log2(t) {
			if (!logObj2) logObj2 = document.getElementById("simpleLog2");
			logObj2.innerHTML += t;
		}
		
	</script>


	<table>
		<tr>
			<td><div id="myForm"></div></td>
			<td><div id="myForm2"></div></td>
		</tr>
		<tr>
			<td><b>Log</b></td>
			<td><b>Log</b></td>
		</tr>
		<tr>
			<td><div id="simpleLog"></div></td>
			<td><div id="simpleLog2"></div></td>
		</tr>
	</table>
			
			
         </div>
    <div style="clear:both;"></div>
    <div class="source">
        <div class="teg">Source</div>
        <div class="code" id="code">
		<div class="hl-main"><pre><span class="hl-brackets">&lt;</span><span class="hl-reserved">link</span><span class="hl-code"> </span><span class="hl-var">rel</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">stylesheet</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-var">type</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">text/css</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-var">href</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">../../codebase/skins/dhtmlxform_dhx_skyblue.css</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-code">
    </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">script</span><span class="hl-code"> </span><span class="hl-var">src</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">../../codebase/dhtmlxcommon.js</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">script</span><span class="hl-brackets">&gt;</span><span class="hl-code">
    </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">script</span><span class="hl-code"> </span><span class="hl-var">src</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">../../codebase/dhtmlxform.js</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">script</span><span class="hl-brackets">&gt;</span><span class="hl-code">
    </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">style</span><span class="hl-brackets">&gt;</span><span class="hl-code">
        div#simpleLog, div#simpleLog2 {
            font-family: Tahoma;
            font-size: 11px;
            margin: 20px 20px 0px 0px;
        }
    </span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">style</span><span class="hl-brackets">&gt;</span><span class="hl-code">
    </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">script</span><span class="hl-brackets">&gt;</span><span class="hl-code"><div class="hl-main"><pre><span class="hl-reserved">var</span><span class="hl-code"> </span><span class="hl-identifier">myForm</span><span class="hl-code">,
</span><span class="hl-identifier">formData</span><span class="hl-code">,
</span><span class="hl-identifier">logObj</span><span class="hl-code">;
</span><span class="hl-reserved">var</span><span class="hl-code"> </span><span class="hl-identifier">myForm2</span><span class="hl-code">,
</span><span class="hl-identifier">logObj2</span><span class="hl-code">;
</span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">doOnLoad</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
 
    </span><span class="hl-comment">//</span><span class="hl-comment"> init from json</span><span class="hl-comment"></span><span class="hl-code">
    </span><span class="hl-identifier">formData</span><span class="hl-code"> = </span><span class="hl-brackets">[</span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-identifier">type</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">settings</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
        </span><span class="hl-identifier">position</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">label-left</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
        </span><span class="hl-identifier">labelWidth</span><span class="hl-code">: </span><span class="hl-number">130</span><span class="hl-code">,
        </span><span class="hl-identifier">inputWidth</span><span class="hl-code">: </span><span class="hl-number">120</span><span class="hl-code">
    </span><span class="hl-brackets">}</span><span class="hl-code">, </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-identifier">type</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">fieldset</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
        </span><span class="hl-reserved">label</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">Init from JSON</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
        </span><span class="hl-identifier">inputWidth</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">auto</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
        </span><span class="hl-identifier">list</span><span class="hl-code">: </span><span class="hl-brackets">[</span><span class="hl-brackets">{</span><span class="hl-code">
            </span><span class="hl-identifier">type</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">radio</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-identifier">name</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">type</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-reserved">label</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">Already have account</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-identifier">labelWidth</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">auto</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-identifier">value</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">have_account</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-identifier">position</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">label-right</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-identifier">checked</span><span class="hl-code">: </span><span class="hl-reserved">true</span><span class="hl-code">,
            </span><span class="hl-identifier">list</span><span class="hl-code">: </span><span class="hl-brackets">[</span><span class="hl-brackets">{</span><span class="hl-code">
                </span><span class="hl-identifier">type</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">input</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-reserved">label</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">Login</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-identifier">value</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">p_rossi</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-identifier">name</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">login</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-identifier">userdata</span><span class="hl-code">: </span><span class="hl-brackets">{</span><span class="hl-code">
                    </span><span class="hl-identifier">max_lentgh</span><span class="hl-code">: </span><span class="hl-number">15</span><span class="hl-code">,
                    </span><span class="hl-identifier">char_allowed</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">a-zA-Z0-9_-</span><span class="hl-quotes">&quot;</span><span class="hl-code">
                </span><span class="hl-brackets">}</span><span class="hl-code">
            </span><span class="hl-brackets">}</span><span class="hl-code">, </span><span class="hl-brackets">{</span><span class="hl-code">
                </span><span class="hl-identifier">type</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">password</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-reserved">label</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">Password</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-identifier">value</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">123</span><span class="hl-quotes">&quot;</span><span class="hl-code">
            </span><span class="hl-brackets">}</span><span class="hl-code">, </span><span class="hl-brackets">{</span><span class="hl-code">
                </span><span class="hl-identifier">type</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">checkbox</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-reserved">label</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">Remember me</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-identifier">checked</span><span class="hl-code">: </span><span class="hl-reserved">true</span><span class="hl-code">
            </span><span class="hl-brackets">}</span><span class="hl-brackets">]</span><span class="hl-code">,
            </span><span class="hl-identifier">userdata</span><span class="hl-code">: </span><span class="hl-brackets">{</span><span class="hl-code">
                </span><span class="hl-identifier">check_session</span><span class="hl-code">: </span><span class="hl-reserved">true</span><span class="hl-code">,
                </span><span class="hl-identifier">exp_days</span><span class="hl-code">: </span><span class="hl-number">10</span><span class="hl-code">
            </span><span class="hl-brackets">}</span><span class="hl-code">
        </span><span class="hl-brackets">}</span><span class="hl-code">, </span><span class="hl-brackets">{</span><span class="hl-code">
            </span><span class="hl-identifier">type</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">radio</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-identifier">name</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">type</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-reserved">label</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">Not registered yet</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-identifier">labelWidth</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">auto</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-identifier">position</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">label-right</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-identifier">list</span><span class="hl-code">: </span><span class="hl-brackets">[</span><span class="hl-brackets">{</span><span class="hl-code">
                </span><span class="hl-identifier">type</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">input</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-reserved">label</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">Login</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-identifier">value</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">p_rossi</span><span class="hl-quotes">&quot;</span><span class="hl-code">
            </span><span class="hl-brackets">}</span><span class="hl-code">, </span><span class="hl-brackets">{</span><span class="hl-code">
                </span><span class="hl-identifier">type</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">password</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-reserved">label</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">Password</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-identifier">value</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">123</span><span class="hl-quotes">&quot;</span><span class="hl-code">
            </span><span class="hl-brackets">}</span><span class="hl-code">, </span><span class="hl-brackets">{</span><span class="hl-code">
                </span><span class="hl-identifier">type</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">password</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-reserved">label</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">Confirm Password</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-identifier">value</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">123</span><span class="hl-quotes">&quot;</span><span class="hl-code">
            </span><span class="hl-brackets">}</span><span class="hl-code">, </span><span class="hl-brackets">{</span><span class="hl-code">
                </span><span class="hl-identifier">type</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">input</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-reserved">label</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">E-mail Address</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
                </span><span class="hl-identifier">value</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">p_rossi@example.com</span><span class="hl-quotes">&quot;</span><span class="hl-code">
            </span><span class="hl-brackets">}</span><span class="hl-brackets">]</span><span class="hl-code">
            </span><span class="hl-brackets">}</span><span class="hl-code">, </span><span class="hl-brackets">{</span><span class="hl-code">
            </span><span class="hl-identifier">type</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">button</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-identifier">value</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">Proceed</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-identifier">name</span><span class="hl-code">: </span><span class="hl-quotes">&quot;</span><span class="hl-string">proceed</span><span class="hl-quotes">&quot;</span><span class="hl-code">,
            </span><span class="hl-identifier">userdata</span><span class="hl-code">: </span><span class="hl-brackets">{</span><span class="hl-code">
                </span><span class="hl-identifier">skip_validation</span><span class="hl-code">: </span><span class="hl-reserved">true</span><span class="hl-code">
            </span><span class="hl-brackets">}</span><span class="hl-code">
        </span><span class="hl-brackets">}</span><span class="hl-brackets">]</span><span class="hl-code">
        </span><span class="hl-brackets">}</span><span class="hl-brackets">]</span><span class="hl-code">;
    </span><span class="hl-identifier">myForm</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">dhtmlXForm</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">myForm</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-identifier">formData</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">checkUserData</span><span class="hl-brackets">(</span><span class="hl-identifier">myForm</span><span class="hl-code">, </span><span class="hl-identifier">log</span><span class="hl-brackets">)</span><span class="hl-code">;
 
    </span><span class="hl-comment">//</span><span class="hl-comment"> init from xml</span><span class="hl-comment"></span><span class="hl-code">
    </span><span class="hl-identifier">myForm2</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">dhtmlXForm</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">myForm2</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">myForm2</span><span class="hl-code">.</span><span class="hl-identifier">loadStruct</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">../common/dhxform_userdata.xml?e=</span><span class="hl-quotes">&quot;</span><span class="hl-code"> + </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-builtin">Date</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-identifier">getTime</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code">, </span><span class="hl-reserved">function</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-identifier">checkUserData</span><span class="hl-brackets">(</span><span class="hl-identifier">myForm2</span><span class="hl-code">, </span><span class="hl-identifier">log2</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-brackets">}</span><span class="hl-brackets">)</span><span class="hl-code">;
 
</span><span class="hl-brackets">}</span><span class="hl-code">
 
</span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">checkUserData</span><span class="hl-brackets">(</span><span class="hl-identifier">form</span><span class="hl-code">, </span><span class="hl-identifier">log</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
 
    </span><span class="hl-comment">//</span><span class="hl-comment"> add some user data manualy</span><span class="hl-comment"></span><span class="hl-code">
    </span><span class="hl-identifier">form</span><span class="hl-code">.</span><span class="hl-identifier">setUserData</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">type</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">have_account</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">check_msg</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-reserved">false</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">form</span><span class="hl-code">.</span><span class="hl-identifier">setUserData</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">proceed</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">session_id</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-identifier">form</span><span class="hl-code">.</span><span class="hl-identifier">_genStr</span><span class="hl-brackets">(</span><span class="hl-number">6</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-code">;
 
    </span><span class="hl-comment">//</span><span class="hl-comment"> read userdata</span><span class="hl-comment"></span><span class="hl-code">
    </span><span class="hl-identifier">log</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">form loaded, attempt to read userdata&lt;br&gt;</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">log</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">input 'Login', &lt;span style='color:blue;'&gt;userdata&lt;/span&gt;: max_length, &lt;span style='color:green;'&gt;value&lt;/span&gt;: </span><span class="hl-quotes">&quot;</span><span class="hl-code"> + </span><span class="hl-identifier">form</span><span class="hl-code">.</span><span class="hl-identifier">getUserData</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">login</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">max_lentgh</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code"> + </span><span class="hl-quotes">&quot;</span><span class="hl-string">&lt;br&gt;</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">log</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">input 'Login', &lt;span style='color:blue;'&gt;userdata&lt;/span&gt;: exp_days, &lt;span style='color:green;'&gt;value&lt;/span&gt;: </span><span class="hl-quotes">&quot;</span><span class="hl-code"> + </span><span class="hl-identifier">form</span><span class="hl-code">.</span><span class="hl-identifier">getUserData</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">login</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">char_allowed</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code"> + </span><span class="hl-quotes">&quot;</span><span class="hl-string">&lt;br&gt;</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">log</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">radiobutton 'Already have account', &lt;span style='color:blue;'&gt;userdata&lt;/span&gt;: check_session, &lt;span style='color:green;'&gt;value&lt;/span&gt;: </span><span class="hl-quotes">&quot;</span><span class="hl-code"> + </span><span class="hl-identifier">form</span><span class="hl-code">.</span><span class="hl-identifier">getUserData</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">type</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">have_account</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">check_session</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-identifier">toString</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code"> + </span><span class="hl-quotes">&quot;</span><span class="hl-string">&lt;br&gt;</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">log</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">radiobutton 'Already have account', &lt;span style='color:blue;'&gt;userdata&lt;/span&gt;: exp_days, &lt;span style='color:green;'&gt;value&lt;/span&gt;: </span><span class="hl-quotes">&quot;</span><span class="hl-code"> + </span><span class="hl-identifier">form</span><span class="hl-code">.</span><span class="hl-identifier">getUserData</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">type</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">have_account</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">exp_days</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code"> + </span><span class="hl-quotes">&quot;</span><span class="hl-string">&lt;br&gt;</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">log</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">radiobutton 'Already have account', &lt;span style='color:blue;'&gt;userdata&lt;/span&gt;: check_msg, &lt;span style='color:green;'&gt;value&lt;/span&gt;: </span><span class="hl-quotes">&quot;</span><span class="hl-code"> + </span><span class="hl-identifier">form</span><span class="hl-code">.</span><span class="hl-identifier">getUserData</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">type</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">have_account</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">check_msg</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-identifier">toString</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code"> + </span><span class="hl-quotes">&quot;</span><span class="hl-string">&lt;br&gt;</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">log</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">button 'Proceed', &lt;span style='color:blue;'&gt;userdata&lt;/span&gt;: skip_validation, &lt;span style='color:green;'&gt;value&lt;/span&gt;: </span><span class="hl-quotes">&quot;</span><span class="hl-code"> + </span><span class="hl-identifier">form</span><span class="hl-code">.</span><span class="hl-identifier">getUserData</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">proceed</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">skip_validation</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-identifier">toString</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code"> + </span><span class="hl-quotes">&quot;</span><span class="hl-string">&lt;br&gt;</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">log</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">button 'Proceed', &lt;span style='color:blue;'&gt;userdata&lt;/span&gt;: session_id, &lt;span style='color:green;'&gt;value&lt;/span&gt;: </span><span class="hl-quotes">&quot;</span><span class="hl-code"> + </span><span class="hl-identifier">form</span><span class="hl-code">.</span><span class="hl-identifier">getUserData</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">proceed</span><span class="hl-quotes">&quot;</span><span class="hl-code">, </span><span class="hl-quotes">&quot;</span><span class="hl-string">session_id</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code"> + </span><span class="hl-quotes">&quot;</span><span class="hl-string">&lt;br&gt;</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
 
</span><span class="hl-brackets">}</span><span class="hl-code">
 
</span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">log</span><span class="hl-brackets">(</span><span class="hl-identifier">t</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
    </span><span class="hl-reserved">if</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-code">!</span><span class="hl-identifier">logObj</span><span class="hl-brackets">)</span><span class="hl-code">
        </span><span class="hl-identifier">logObj</span><span class="hl-code"> = </span><span class="hl-builtin">document</span><span class="hl-code">.</span><span class="hl-identifier">getElementById</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">simpleLog</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">logObj</span><span class="hl-code">.</span><span class="hl-identifier">innerHTML</span><span class="hl-code"> += </span><span class="hl-identifier">t</span><span class="hl-code">;
</span><span class="hl-brackets">}</span><span class="hl-code">
 
</span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">log2</span><span class="hl-brackets">(</span><span class="hl-identifier">t</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
    </span><span class="hl-reserved">if</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-code">!</span><span class="hl-identifier">logObj2</span><span class="hl-brackets">)</span><span class="hl-code">
        </span><span class="hl-identifier">logObj2</span><span class="hl-code"> = </span><span class="hl-builtin">document</span><span class="hl-code">.</span><span class="hl-identifier">getElementById</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">simpleLog2</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-identifier">logObj2</span><span class="hl-code">.</span><span class="hl-identifier">innerHTML</span><span class="hl-code"> += </span><span class="hl-identifier">t</span><span class="hl-code">;
</span><span class="hl-brackets">}</span></pre></div></span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">script</span><span class="hl-brackets">&gt;</span><span class="hl-code">
 
 
    </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">table</span><span class="hl-brackets">&gt;</span><span class="hl-code">
        </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">tr</span><span class="hl-brackets">&gt;</span><span class="hl-code">
            </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">td</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">div</span><span class="hl-code"> </span><span class="hl-var">id</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">myForm</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">div</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">td</span><span class="hl-brackets">&gt;</span><span class="hl-code">
            </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">td</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">div</span><span class="hl-code"> </span><span class="hl-var">id</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">myForm2</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">div</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">td</span><span class="hl-brackets">&gt;</span><span class="hl-code">
        </span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">tr</span><span class="hl-brackets">&gt;</span><span class="hl-code">
        </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">tr</span><span class="hl-brackets">&gt;</span><span class="hl-code">
            </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">td</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">b</span><span class="hl-brackets">&gt;</span><span class="hl-code">Log</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">b</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">td</span><span class="hl-brackets">&gt;</span><span class="hl-code">
            </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">td</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">b</span><span class="hl-brackets">&gt;</span><span class="hl-code">Log</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">b</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">td</span><span class="hl-brackets">&gt;</span><span class="hl-code">
        </span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">tr</span><span class="hl-brackets">&gt;</span><span class="hl-code">
        </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">tr</span><span class="hl-brackets">&gt;</span><span class="hl-code">
            </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">td</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">div</span><span class="hl-code"> </span><span class="hl-var">id</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">simpleLog</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">div</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">td</span><span class="hl-brackets">&gt;</span><span class="hl-code">
            </span><span class="hl-brackets">&lt;</span><span class="hl-reserved">td</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">div</span><span class="hl-code"> </span><span class="hl-var">id</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">simpleLog2</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">div</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">td</span><span class="hl-brackets">&gt;</span><span class="hl-code">
        </span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">tr</span><span class="hl-brackets">&gt;</span><span class="hl-code">
    </span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">table</span><span class="hl-brackets">&gt;</span></pre></div>
        </div>
    <div class="footer">
        <div class="footer-logo"></div>
        <div class="copyright">Copyright &copy; 1998-2012 DHTMLX LTD.<br />All rights reserved.</div>
    </div>
	</body>
</html>